package com.mars.basic.allmain.dto;

import com.mars.basic.allmain.po.Picture;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class PictureMdDto {

    private  Integer pictureId;

    private String url;

    private String fileName;

    /**
     * 获取md图片信息
     * @param picture
     * @return
     */
    public static PictureMdDto build(Picture picture) {
        PictureMdDto build = PictureMdDto.builder().fileName(picture.getName())
                .url(picture.getUrl())
                .pictureId(picture.getId())
                .build();
        return build;
    }
}
